/**
 * 作者：陈文斌 on 2019/1/30.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';

class EnterButton extends StatelessWidget {
  final VoidCallback onPressed;
  final String text;

  EnterButton({
    Key key,
    this.text,
    @required this.onPressed,
  }) : super(key: key);

  final TextStyle _textStyle = TextStyle(
    color: Colors.white,
    fontSize: AppFontSizes.Font17,
    fontFamily: AppFontFamilies.PingFangSC,
  );

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: MediaQuery.of(context).size.width,
      height: 40,
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: AppScreen.setWidth(29)),
        child: ClipRRect(
          borderRadius: BorderRadius.circular(20),
          child: MaterialButton(
            onPressed: onPressed,
            child: Text(
              text,
              style: _textStyle,
            ),
            color: AppColors.MainColor,
          ),
        ),
      ),
    );
  }
}
